//***************************************************************** //* NTHU General Physics Laboratory * //* 109.04.14 * //* Code by Tendy Yeh a4100791ex@gmail.com * //* * //* LED illuminance-Voltage expriment with Snapino, visit * //* http://www.phys.nthu.edu.tw/~gplab/ for more infomation * //***************************************************************** void setup() { Serial.begin(2000000); //開啟序列埠通訊 } void loop() { Serial.println(analogRead(A0)*5.0/1023.0,6); //讀取A0訊號並換算為電壓值,由序列埠輸出資料,精度至小數點後6位 }